home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!sschaem
- From: sschaem@teleport.com (Stephan Schaem)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: PPC compilers
- Date: 9 Jan 1996 20:42:21 GMT
- Organization: Teleport - Portland's Public Access (503) 220-1016
- Distribution: world
- Message-ID: <4cujve$dmn@maureen.teleport.com>
- References: <john.hendrikx.40ka@grafix.xs4all.nl> <4b77tq$htp@serpens.rhein.de> <MQAQx*XOe@yaps.rhein.de> <4bqhnf$6g5@sunsystem5.informatik.tu-muenchen.de> <jasonb.820051107@cs.uwa.edu.au> <4c9i2l$h3i@sunsystem5.informatik.tu-muenchen.de> <4cf0ep$233@ra.i
- <4ck37m$g07@maureen.teleport.com> <4cs8ce$ljg@ra.ibr.cs.tu-bs.de>
- NNTP-Posting-Host: kelly.teleport.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Lars Duening (duening@ibr.cs.tu-bs.de) wrote:
- : I need to know if it's a scalar type (further subdivided into integer
- : and floating types), an array, a structure, a pointer or else, but I
- : do not need to know it's exakt size in byte when using it.
-
- You need to know the type range... if you choose to ignore this, you
- will have to select the largest type avail for real/interger.
- But the point really is you need to know and keep track what your
- variable are. basicly in asm you write what you are thinking,
- but with a limited range of type and no typedef offered.
-
- : Sometimes I don't even need to know the exact type 'cause the compiler
- : will create conversion code plus overflow checking (I'm not talking
- : just C here).
-
- I think thats a bad practice... just for the fact that you let the
- compiler tell you what you assumed wrong.
-
- : In optimum cases, the values of the chipregs have been assigned own
- : types, so I can just write 'blt0con_t *b;' or less specific 'int32
- : *b;'. Again I don't need to know the size of the type, just which of
- : the scalar integer types it is.
-
- Well, what really stop you to think the same way in asembler?
- just treat .w has a type... has long has you know the type of
- your variable in C the compiler wont nag, and you wont get type
- bug in asm (In assmbler the programmer is 'always' right ;)
-
- : > Otherwise you need to know that color0 is a word holding 12bit
- : > of valid data grouped in 4bit nibles,
-
- : typedef struct {
- : int r : 4;
- : int g : 4;
- : int b : 4;
- : } color0_t;
-
- : color0_t color0;
-
- Now somewhere one should read the range of r,g,b... or you must
- also provide a set of routine that will work on this structure/type
- (Example: only value from 0 to 12 are valid. But you will make your
- user function prototype use float and define the valid range)
-
- Stephan
-